package collection;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo1 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        c.add("苹果");
        c.add("香蕉");
        c.add("梨子");
        c.add("西瓜");
        c.add("榴莲");
        c.add("木瓜");
        c.add("芒果");
        c.add("李子");
        c.add("山竹");
        c.add("樱桃");
        System.out.println(c);

        int size = c.size();
        System.out.println("size:"+size);

        boolean isEmpty = c.isEmpty();
        System.out.println("是否为空集：" + isEmpty);

        c.clear();
        System.out.println("集合已清空");

        System.out.println("size:"+c.size());
        System.out.println("是否为空集：" + isEmpty);
    }
}
